package com.genersoft.iot.vmp.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ：mengfanlu
 * @date ：Created in 2023/5/19 11:32
 * @description：...
 * @modified By：
 * @version: ${1.0.0}
 */
public class SDPUtils {
    public static Map<String, String> parseSdpSessionName(String sdp) {
        Map<String, String> attributes = new HashMap<>();

        String[] lines = sdp.split("\r\n");
        for (String line : lines) {
            if (line.startsWith("s=")) {
                String[] parts = line.split("=");
                if (parts.length == 2) {
                    String key = parts[0];
                    String value = parts[1];
                    attributes.put(key, value);
                }
            }
        }

        return attributes;
    }
}
